﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using FluentValidation;

namespace Home.Utilities.Validation.ExtensionMethods
{
    public static class FluentValidatorExtensions
    {
        /// <summary>
        /// 用户名验证
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <param name="ruleBuilder"></param>
        /// <returns></returns>
        public static IRuleBuilderOptions<T, string> UserName<T>(this IRuleBuilder<T, string> ruleBuilder)
        {
            return ruleBuilder.SetValidator(new UserNameValidator());
        }

    }
}
